<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>种子检查系统登录页面</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link href="<%=request.getContextPath() %>/css/login.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery-1.7.2.js"></script>
<script type="text/javascript">
	function validateUser() {
		var username = $("#username").attr("value");
		var password = $("#password").attr("value");
		if (username == "" || username == null) {
			document.getElementById("username-span").innerHTML = "用户名不可以为空!";
			return false;
		}
		if (password == "" || password == null) {
			document.getElementById("password-span").innerHTML = "密码不可以为空！";
			return false;
		}
		
		$.ajax({
		url : "<%=request.getContextPath()%>/ajax.form",
		type : 'POST',
		data : "username="+username+"&password="+password+"&key=userlogin-validate",
		dataType : 'json',
		async:false,
		contentType: "application/x-www-form-urlencoded; charset=utf-8",
		timeout : 3000,
		error : function(XMLHttpRequest, textStatus, errorThrown){
			alert('Error ' + XMLHttpRequest + textStatus + errorThrown);
		},
		success : function(result){
			if(result["status"]=="error")
			{
				document.getElementById("username-span").innerHTML = result["username"];
				document.getElementById("password-span").innerHTML = result["password"];
			}else
			{
				document.getElementsByTagName("form")[0].submit();
			}
		}
	});
		
		
	}
</script>
</head>

<body>
<div id="content" align="center">
	<div id="content1">
		<div id="logo"></div><!--logo-->
		<div id="left"></div><!--left-->
		<div id="login">
			<div id="login1">
			 <form action="/corn-test/login/user.form" method="post">
			  <table width="278" height="258" border="0" cellpadding="10" style="margin-top:15px;*margin-top:15px;_margin-top:15px;">
                <tr>
                  <th colspan="2" scope="row"><div align="left">登录名：</div></th>
                </tr>
                <tr>
                  <th colspan="2" scope="row"><div align="left"><input type="text" name="username"  id="username" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" 
style="width: 250" 
onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" /><span id="username-span" style="color: red;font-size: 12px;"></span></div> </th>
                </tr>
                <tr>
                  <th colspan="2" scope="row"><div align="left">登录密码：</div></th>
                </tr>
                <tr>
                  <th colspan="2" scope="row"><div align="left"><input type="password" name="password" id="password" onmouseover="this.style.borderColor='black';this.style.backgroundColor='plum'" 
style="width: 250" 
onmouseout="this.style.borderColor='black';this.style.backgroundColor='#ffffff'" /><span id="password-span" style="color:red;font-size: 12px;"></span></div> </th>
                </tr>
               
                <tr>
                  <th colspan="2" scope="row"><div align="left"><input type="image" src="<%=request.getContextPath() %>/images/032.png" onclick="validateUser();"  width="258" height="40" border="0"/></div></th>
                </tr>
               
              </table>
              </form>
			</div><!--login1-->
		</div><!--login-->
		<div id="footer">
			<div id="footer1">
				<ul>
					<li>辽宁农业基因中心</li>
					<li>辽宁农业基因中心</li>
					<li>辽宁农业基因中心</li>
					<li>辽宁农业基因中心</li>
					<li>辽宁农业基因中心</li>
					<li style="border:none">辽宁农业基因中心</li>
				</ul>
			</div><!--footer1-->
			<div id="footer2">
				<div id="footer3">关于dna&nbsp;&nbsp;合作伙伴&nbsp;&nbsp;营销中心&nbsp;&nbsp;服务中心&nbsp;&nbsp;开放平台&nbsp;&nbsp;诚征英才&nbsp;&nbsp;联系我们&nbsp;&nbsp;网站地图&nbsp;&nbsp;版权说明 </div><!--footer3-->
				<div id="footer4">© 2013&nbsp;&nbsp;植物dna检测中心&nbsp;&nbsp;版权所有</div><!--footer4-->
			</div><!--footer2-->
		</div><!--footer-->
	</div><!--content1-->
</div><!--content-->
</body>
</html>
